package oop5;

/**
 * @author oldliu
 * @since 1.0
 */
public  class USBHardDisk implements Usb {
    private String brand;
    private int cap;//容量 G

    public USBHardDisk(String brand, int cap) {
        this.brand = brand;
        this.cap = cap;
    }

    @Override
    public String toString() {
        return "U盘，牌子是"+this.brand+",容量是"+cap+"G";
    }

    public void read(){
        System.out.println("从"+this.brand+"的U盘读出了数据。1010011000");
    }
    public void write(){
        System.out.println("向"+this.brand+"的U盘写入了数据。1010011000");
    }
    @Override
    public void plugin() {
        System.out.println(brand+"的u盘插入了usb口，指示灯亮");
    }

    @Override
    public void work() {
        System.out.println("u盘被电脑识别了，可以读取或者写入数据了");
    }


    @Override
    public void stop() {
        System.out.println(brand+"的u盘从usb口移除，指示灯灭了");
    }
}
